package com.qing.springcloud.dto.user;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author caozhipeng
 * @date 2025/7/9
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class UserDTO {
    // 用户 ID
    private Long id;
    // 用户名
    private String username;
    // 用户昵称
    private String nickname;
    // 用户邮箱
    private String email;
    // 用户手机号
    private String phone;

//    用户头像
    private String avatar;

    /**
     * 最后登录时间
     */
    private Date lastLogin;

    public UserDTO(Long id, String username, String nickname) {
        this.id = id;
        this.username = username;
        this.nickname = nickname;
    }

    @Override
    public String toString() {
        return "UserDTO{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", nickname='" + nickname + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", avatar='" + avatar + '\'' +
                ", lastLogin=" + lastLogin +
                '}';
    }
}